@SETLOCAL ENABLEDELAYEDEXPANSION
@for /F "usebackq" %%i in (`type "%~dsp0\..\build\current.txt"`) do SET BUILD=%%i

@SET "policyConfigFile=%~dsp0\policy.1.0.NTrace.config"
@echo ^<configuration^> > "%policyConfigFile%"
@echo   ^<runtime^> >> "%policyConfigFile%"
@echo     ^<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"^> >> "%policyConfigFile%"
@echo       ^<dependentAssembly^> >> "%policyConfigFile%"
@echo         ^<assemblyIdentity name="NTrace" >> "%policyConfigFile%"
@echo                           publicKeyToken="e903e026521806f6" /^> >> "%policyConfigFile%"
@echo         ^<bindingRedirect oldVersion="1.0.17.0" >> "%policyConfigFile%"
@echo                          newVersion="2.0.0.0"/^> >> "%policyConfigFile%"
@echo       ^</dependentAssembly^> >> "%policyConfigFile%"
@echo     ^</assemblyBinding^> >> "%policyConfigFile%"
@echo   ^</runtime^> >> "%policyConfigFile%"
@echo ^</configuration^> >> "%policyConfigFile%"

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\al.exe" /link:"%policyConfigFile%" /out:"%~dsp0\policy.1.0.NTrace.dll" /keyfile:"%~dsp0\..\keys\NTrace.snk" /platform:AnyCPU /v:2.0.0.0